package com.fhz.a2102shopjava.ui.home;

import androidx.lifecycle.LiveData;

import com.fhz.a2102shopjava.anno.LiveDataCallAdapterFengService;
import com.fhz.a2102shopjava.api.FengService;
import com.fhz.a2102shopjava.base.BaseDataSource;
import com.fhz.a2102shopjava.callback.ApiResponse;
import com.fhz.a2102shopjava.entity.Banner;
import com.fhz.a2102shopjava.entity.GoodsInfo;
import com.fhz.a2102shopjava.entity.ResponseBean;
import com.fhz.a2102shopjava.util.RetrofitUtil;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;
import retrofit2.http.Query;

/**
 * 时间:2023/8/15
 *
 * @author Mr.Feng
 * 简述: TODO
 */
public class HomeDataSource extends BaseDataSource {
    @Inject
    @LiveDataCallAdapterFengService
    public FengService mFengService;

    @Inject
    public HomeDataSource() {
    }

    public LiveData<ApiResponse<ResponseBean<List<Banner>>>> getBanner(int type, int page , int pageSize){
        return mFengService.getBannerByType(type, page, pageSize);
    }

    /**
     * 首页推荐的商品
     * @param page
     * @param pageSize
     * @return
     */
    public LiveData<ApiResponse<ResponseBean<List<GoodsInfo>>>> getGoodsInfo(@Query("page") int page, @Query("pageSize") int pageSize){
        return mFengService.getGoodsInfo(page, pageSize);
    }


}   
